package com.lb.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.lb.bean.Message;
import com.lb.bean.Reply;

public class ReplyDAOImpl extends HibernateDaoSupport implements ReplyDAO {

	public void save(Reply reply) {
		this.getHibernateTemplate().save(reply);

	}
	@SuppressWarnings("unchecked")
	public List<Reply> findreplyBymessageId(int messageId){
		return this.getHibernateTemplate().find("from Reply re where re.messageId=?",messageId);
	}
	@SuppressWarnings("unchecked")
	public List<Message> findmessageBymessageId(int messageId){
		return this.getHibernateTemplate().find("from Message ms where ms.messageId=?",messageId);
		
	}
}
